<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>"五星级宿舍"评比系统用户登陆</title>
	<link rel="stylesheet" href="__PUBLIC__/css/reset.css" type="text/css" media="screen" />
	<link rel="stylesheet" href="__PUBLIC__/css/login_style.css" type="text/css" media="screen" />
	<!--link href="__PUBLIC__/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" /-->
	<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
</head>
<body id="login">
	<div id="login-wrapper" class="png_bg">
	
		<div id="login-top"></div>
		
		<div id="login-content">
			<p class="first_line">
				<label>用户名</label> <input class="text-input" type="text"
						name="username" id="username" /><span class="err" name="account"></span>
			</p>
			<div class="clear"></div>
			<p>
				<label>密码</label> <input class="text-input" type="password"
					name="password" id="password" /><span class="err" name="passwored"></span>
			</p>
			<div class="clear"></div>
			<p>
				<input id="loginButton" class="button" type="button" value="登陆" />
			</p>
		</div>
		<script>
			var login_url = "<?php echo U('Index/Index/login');?>";
			$("#loginButton").click(function(){
				var account=$("#username").val();
				if(account!=undefined&&account.length>0){
					var password = $("#password").val();
					if(password!=undefined&&password.length>0){
						$.post(login_url,{account:account,password:password},function(data){
							if(data.status== 0){
								if(data.account)
									$("#login-content").find("span[name='account']").text(data.account);
								if(data.password)
									$("#login-content").find("span[name='password']").text(data.password);	
							}else if(data.status == 1){
								if(data.type==0)
									window.location.href="<?php echo U("Admin/Message/index");?>";
								else
									window.location.href="<?php echo U("Index/Query/index");?>";
							}
						},'json');
					}
				}
			});
		</script>
		
	</div>
</body>
</html>